@font-face {
  font-family: "PT Sans Bold";
  src: url("./assets/PT_Sans/PTSans-Bold.ttf") format("ttf");
}

@font-face {
  font-family: "PT Serif";
  src: url("./assets/PT_Serif/PTSerif-Regular.ttf") format("ttf");
}

$sans: "PT Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
$serif: "PT Serif", Georgia, "Times New Roman", Times, serif;
$one-col-width-min: 879px;

html {
  background: #f9eee6;
}

body {
  max-width: 880px;
  margin: 4rem auto;
  font-size: 16px;
  line-height: 22px;
  font-family: $serif;

  @media (max-width: $one-col-width-min) {
    margin: 1rem;
  }
}

.section {
  margin-bottom: 2rem;  

  ul {
    padding-left: 0.6rem;
  }
}

code {
  font-size: 0.8rem;
  line-height: 1.2rem;
}

hr {
  background: #fc7c00;
  border: none;
  height: 3px;
}

// Splits the content into two, unless on a tiny horizontal screen
// and then use one column

.split {
  display: flex;
  width: 100%;

  .reverse {
    flex-direction: row-reverse;
  }

  > div {
    flex: 1;
    width: 50%;
  }

  > article {
    flex: 1;
  }

  @media (max-width: $one-col-width-min) {
    flex-direction: column;

    > div {
      width: auto;
    }
  }

  @media (min-width: $one-col-width-min) {
    > * {
      margin: 0 20px;
    }
    > :first-child {
      margin-left: 0;
    }
    > :last-child {
      margin-right: 0;
    }
  }
}

.two-thirds {
  font: $sans;
  
  p {
    font-size: 1.2rem;
    line-height: 1.8rem;
  }
  
  @media (min-width: $one-col-width-min) {
    display: flex;
    .one {
      margin-left: 10%;
      width: 20%;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .two {
      width: 55%;
      margin-right: 15%;
    }
  }
}

.one-column-center {
  @media (min-width: $one-col-width-min) {
    width: 50%;
    margin: 0 auto    ;
  }
}

h1,
h2,
h3,
h4 {
  font-family: $sans;
  text-align: center;
}

h2 {
  margin-top: 120px;
}

aside {
  max-width: 400px;
  text-align: center;
  margin: 0 auto;
  font-style: oblique;
  margin-bottom: 50px;

  a {
    color: black
  }
}

h1 {
  padding-top: 4px;
  font-size: 1rem;
  em {
    color: #706b67;
  }
}

h2::after {
  content: "";
  margin: 20px auto;
  display: block;
  max-width: 400px;
  height: 2px;
  background: #fc7c00;
}

.question {
  font-family: $sans;
  color: #d17924;

  text-align: center;
  font-size: 1.2rem;
}

p > code {
  background-color: #f5dac2;
  display: inline-block;
  border-radius: 4px;
  color: #222;
}

.faq {
  display: flex;
  flex-wrap: wrap;

  @media (max-width: $one-col-width-min) {
    width: 100%;
    > div {
      margin-bottom: 4rem;
    }
  }

  @media (min-width: $one-col-width-min) {
    > div:nth-child(odd) {
      margin-right: 20px;
    }

    > div:nth-child(even) {
      margin-left: 20px;
    }

    > div {
      width: calc(50% - 40px);
      margin-bottom: 2rem;
    }
  }
}

#site-header {
  display: flex;
  margin: 4rem auto;
  justify-content: center;

  #logo {
    flex-direction: column;
    display: flex;
    justify-content: center;
    margin-right: 20px;
  }

  div > * {
    margin:0;
    text-align: left;
    font-weight: normal;
    font-size: 1.3rem;
    font-family: $sans; 
  }
}

a.button {
  color: black;
  background-color: #FC7C0020;
  text-decoration: none;
  padding: 10px;
  margin-bottom:  20px;
  border-left: 2px solid #FC7C00;
  font-size: 1rem;
  h5 {
    font-size: 1.1rem;
    margin: 0.4rem 0 ;
  }
  p {
    margin: 0;
  }
  &:hover {
    background-color: #FC7C0010;
  }
}

.code-sample {
  position: relative;

  h4.code-title {
    margin-bottom: -8px;
    text-align: left;
  }

  .emoji {
    position: absolute;
    bottom: -8px;
    right: 0px;
  }

} 
.code-after {
  margin-top: -2.2rem;
  text-align: right;
  opacity: 0.5;
}

/*  Start of Shiki Twoslash CSS:

Code blocks structurally look like: 

<pre class='shiki lsp twoslash [theme-name]'>
  <div class='language-id'>[lang-id]</div>
    <div class='code-container'>
      <code>[the code as a series of spans]</code>
      <a href='playground...'>Try</a> (optional)
    </div>
  </pre> 
*/

pre {
  /* In theory shiki will overwrite these, but this is to make sure there are defaults regardless */
  background-color: #F9EEE6 !important;
  color: black;

  /* Give it some space to breathe */
  padding: 12px 0 ;

  /* All code samples get a grey border, twoslash ones get a different color */
  border-left: 1px solid #444;
  border-bottom: 1px solid #444;

  margin-bottom: 3rem;

  /* Important to allow the code to move horizontally; */
  overflow-x: auto;
  position: relative;
}
pre.shiki {
  overflow-x: auto;
}
pre.shiki:hover .dim {
  opacity: 1;
}
pre.shiki div.dim {
  opacity: 0.5;
}
pre.shiki div.dim,
pre.shiki div.highlight {
  margin: 0;
  padding: 0;
}
pre.shiki div.highlight {
  opacity: 1;
  background-color: #f1f8ff;
}
pre.shiki div.line {
  min-height: 1rem;
}

/** Don't show the language identifiers */
pre.shiki .language-id {
  display: none;
}


/** When you mouse over the pre, show the underlines */
pre.twoslash:hover data-lsp {
  border-color: #747474;
}

/** The tooltip-like which provides the LSP response */
pre.twoslash data-lsp:hover::before {
  content: attr(lsp);
  position: absolute;
  transform: translate(0, 1rem);

  background-color: #3f3f3f;
  color: #fff;
  text-align: left;
  padding: 5px 8px;
  border-radius: 2px;
  font-family: "JetBrains Mono", Menlo, Monaco, Consolas, Courier New, monospace;
  font-size: 14px;
  white-space: pre-wrap;
  z-index: 100;
}

pre .code-container {
  overflow: auto;
}

/* Respect no animations */
@media (prefers-reduced-motion: reduce) {
  pre .code-container > a {
    transition: none;
  }
}
pre .code-container > a:hover {
  color: white;
  background-color: #719af4;
}
pre .code-container:hover a {
  opacity: 1;
}

pre code {
  font-family: "JetBrains Mono", Menlo, Monaco, Consolas, Courier New, monospace;
  white-space: pre;
  -webkit-overflow-scrolling: touch;
}
pre code a {
  text-decoration: none;
}
pre data-err {
  /* Extracted from VS Code */
  background: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%206%203'%20enable-background%3D'new%200%200%206%203'%20height%3D'3'%20width%3D'6'%3E%3Cg%20fill%3D'%23c94824'%3E%3Cpolygon%20points%3D'5.5%2C0%202.5%2C3%201.1%2C3%204.1%2C0'%2F%3E%3Cpolygon%20points%3D'4%2C0%206%2C2%206%2C0.6%205.4%2C0'%2F%3E%3Cpolygon%20points%3D'0%2C2%201%2C3%202.4%2C3%200%2C0.6'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")
    repeat-x bottom left;
  padding-bottom: 3px;
}
pre .query {
  margin-bottom: 10px;
  color: #137998;
  display: inline-block;
}

.line {
  padding-left: 1rem;
  padding-right: 1rem;
}


/* In order to have the 'popped out' style design and to not break the layout
  /* we need to place a fake and un-selectable copy of the error which _isn't_ broken out
  /* behind the actual error message.

  /* This sections keeps both of those two in in sync  */

pre .error,
pre .error-behind {
  margin-left: -14px;
  margin-top: 8px;
  margin-bottom: 4px;
  padding: 6px;
  padding-left: 14px;
  width: calc(100% - 20px);
  white-space: pre-wrap;
  display: block;
}
pre .error {
  position: absolute;
  background-color: #fee;
  border-left: 2px solid #bf1818;
  /* Give the space to the error code */
  display: flex;
  align-items: center;
  color: black;
}
pre .error .code {
  display: none;
}
pre .error-behind {
  user-select: none;
  visibility: transparent;
  color: #fee;
}
/* Queries */
pre .arrow {
  /* Transparent background */
  background-color: #eee;
  position: relative;
  top: -7px;
  margin-left: 0.1rem;
  /* Edges */
  border-left: 1px solid #eee;
  border-top: 1px solid #eee;
  transform: translateY(25%) rotate(45deg);
  /* Size */
  height: 8px;
  width: 8px;
}
pre .popover {
  margin-bottom: 10px;
  background-color: #eee;
  display: inline-block;
  padding: 0 0.5rem 0.3rem;
  margin-top: 10px;
  border-radius: 3px;
}
/* Completion */
pre .inline-completions ul.dropdown {
  display: inline-block;
  position: absolute;
  width: 240px;
  background-color: gainsboro;
  color: grey;
  padding-top: 4px;
  font-family: var(--code-font);
  font-size: 0.8rem;
  margin: 0;
  padding: 0;
  border-left: 4px solid #4b9edd;
}
pre .inline-completions ul.dropdown::before {
  background-color: #4b9edd;
  width: 2px;
  position: absolute;
  top: -1.2rem;
  left: -3px;
  content: " ";
}
pre .inline-completions ul.dropdown li {
  overflow-x: hidden;
  padding-left: 4px;
  margin-bottom: 4px;
}
pre .inline-completions ul.dropdown li.deprecated {
  text-decoration: line-through;
}
pre .inline-completions ul.dropdown li span.result-found {
  color: #4b9edd;
}
pre .inline-completions ul.dropdown li span.result {
  width: 100px;
  color: black;
  display: inline-block;
}
.dark-theme .markdown pre {
  background-color: #d8d8d8;
  border-color: #ddd;
  filter: invert(98%) hue-rotate(180deg);
}
data-lsp {
  /* Ensures there's no 1px jump when the hover happens */
  border-bottom: 1px dotted transparent;
  /* Fades in unobtrusively */
  transition-timing-function: ease;
  transition: border-color 0.3s;
}
/* Respect people's wishes to not have animations */
@media (prefers-reduced-motion: reduce) {
  data-lsp {
    transition: none;
  }
}

pre .logger {
  display: flex;
  align-items: center;
  color: #000;
  padding: 6px 6px 6px 8px;
  width: calc(100% - 19px);
  white-space: pre-wrap;
  margin-top: 10px;
}

pre .logger svg {
  margin-right:9px
}

pre .logger.error-log {
  background-color: #fee;
  color: #ff0b0b;
  border-left: 1px solid #bf1818
}

pre .logger.warn-log {
  background-color: #ffe;
  border-left: 1px solid #eae662
}

pre .logger.log-log {
  background-color: #f3f3f3;
  border-left: 1px solid #f3f3f3
}

pre .logger.log-log svg {
  margin-left: 6px;
  margin-right:9px
}

